Integrand size = 24, antiderivative size = 172 \[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{a d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{2 a d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{2 a d^2}-\frac {f \sec (c+d x)}{2 a d^2}-\frac {(e+f x) \sec ^2(c+d x)}{2 a d}+\frac {f \tan (c+d x)}{2 a d^2}+\frac {(e+f x) \sec (c+d x) \tan (c+d x)}{2 a d} \]
-I*(f*x+e)*arctan(exp(I*(d*x+c)))/a/d+1/2*I*f*polylog(2,-I*exp(I*(d*x+c))) /a/d^2-1/2*I*f*polylog(2,I*exp(I*(d*x+c)))/a/d^2-1/2*f*sec(d*x+c)/a/d^2-1/ 2*(f*x+e)*sec(d*x+c)^2/a/d+1/2*f*tan(d*x+c)/a/d^2+1/2*(f*x+e)*sec(d*x+c)*t an(d*x+c)/a/d
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(655\) vs. \(2(172)=344\).
Time = 7.49 (sec) , antiderivative size = 655, normalized size of antiderivative = 3.81 \[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {2 d (e+f x)-4 f \sin \left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+(c+d x) (c f-d (2 e+f x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2+d e \left (c+d x+2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2-c f \left (c+d x+2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2+d e \left (c+d x-2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2-c f \left (c+d x-2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2-\frac {f \left ((-1)^{3/4} (c+d x)^2+\frac {-3 i \pi (c+d x)-4 \pi \log \left (1+e^{-i (c+d x)}\right )+2 (-2 c+\pi -2 d x) \log \left (1+i e^{i (c+d x)}\right )+4 \pi \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 \pi \log \left (\sin \left (\frac {1}{4} (2 c-\pi +2 d x)\right )\right )+4 i \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\sqrt {2}}\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}{\sqrt {2}}+\frac {f \left (\sqrt [4]{-1} (c+d x)^2+\frac {-i \pi (c+d x)-4 \pi \log \left (1+e^{-i (c+d x)}\right )-2 (2 c+\pi +2 d x) \log \left (1-i e^{i (c+d x)}\right )+4 \pi \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 \pi \log \left (\sin \left (\frac {1}{4} (2 c+\pi +2 d x)\right )\right )+4 i \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\sqrt {2}}\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}{\sqrt {2}}}{4 a d^2 (1+\sin (c+d x))} \]
-1/4*(2*d*(e + f*x) - 4*f*Sin[(c + d*x)/2]*(Cos[(c + d*x)/2] + Sin[(c + d* x)/2]) + (c + d*x)*(c*f - d*(2*e + f*x))*(Cos[(c + d*x)/2] + Sin[(c + d*x) /2])^2 + d*e*(c + d*x + 2*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])*(Cos[( c + d*x)/2] + Sin[(c + d*x)/2])^2 - c*f*(c + d*x + 2*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 + d*e*(c + d* x - 2*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 - c*f*(c + d*x - 2*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) *(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 - (f*((-1)^(3/4)*(c + d*x)^2 + (( -3*I)*Pi*(c + d*x) - 4*Pi*Log[1 + E^((-I)*(c + d*x))] + 2*(-2*c + Pi - 2*d *x)*Log[1 + I*E^(I*(c + d*x))] + 4*Pi*Log[Cos[(c + d*x)/2]] - 2*Pi*Log[Sin [(2*c - Pi + 2*d*x)/4]] + (4*I)*PolyLog[2, (-I)*E^(I*(c + d*x))])/Sqrt[2]) *(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2)/Sqrt[2] + (f*((-1)^(1/4)*(c + d* x)^2 + ((-I)*Pi*(c + d*x) - 4*Pi*Log[1 + E^((-I)*(c + d*x))] - 2*(2*c + Pi + 2*d*x)*Log[1 - I*E^(I*(c + d*x))] + 4*Pi*Log[Cos[(c + d*x)/2]] + 2*Pi*L og[Sin[(2*c + Pi + 2*d*x)/4]] + (4*I)*PolyLog[2, I*E^(I*(c + d*x))])/Sqrt[ 2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2)/Sqrt[2])/(a*d^2*(1 + Sin[c + d*x]))
Time = 0.80 (sec) , antiderivative size = 163, normalized size of antiderivative = 0.95, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.458, Rules used = {5042, 3042, 4673, 3042, 4669, 2715, 2838, 4909, 3042, 4254, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(e+f x) \sec (c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 5042 |
\(\displaystyle \frac {\int (e+f x) \sec ^3(c+d x)dx}{a}-\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (e+f x) \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{a}-\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}\) |
\(\Big \downarrow \) 4673 |
\(\displaystyle \frac {\frac {1}{2} \int (e+f x) \sec (c+d x)dx-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}-\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} \int (e+f x) \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}-\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}\) |
\(\Big \downarrow \) 4669 |
\(\displaystyle -\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}+\frac {\frac {1}{2} \left (-\frac {f \int \log \left (1-i e^{i (c+d x)}\right )dx}{d}+\frac {f \int \log \left (1+i e^{i (c+d x)}\right )dx}{d}-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle -\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}+\frac {\frac {1}{2} \left (\frac {i f \int e^{-i (c+d x)} \log \left (1-i e^{i (c+d x)}\right )de^{i (c+d x)}}{d^2}-\frac {i f \int e^{-i (c+d x)} \log \left (1+i e^{i (c+d x)}\right )de^{i (c+d x)}}{d^2}-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle -\frac {\int (e+f x) \sec ^2(c+d x) \tan (c+d x)dx}{a}+\frac {\frac {1}{2} \left (-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 4909 |
\(\displaystyle -\frac {\frac {(e+f x) \sec ^2(c+d x)}{2 d}-\frac {f \int \sec ^2(c+d x)dx}{2 d}}{a}+\frac {\frac {1}{2} \left (-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\frac {(e+f x) \sec ^2(c+d x)}{2 d}-\frac {f \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx}{2 d}}{a}+\frac {\frac {1}{2} \left (-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle -\frac {\frac {f \int 1d(-\tan (c+d x))}{2 d^2}+\frac {(e+f x) \sec ^2(c+d x)}{2 d}}{a}+\frac {\frac {1}{2} \left (-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle -\frac {\frac {(e+f x) \sec ^2(c+d x)}{2 d}-\frac {f \tan (c+d x)}{2 d^2}}{a}+\frac {\frac {1}{2} \left (-\frac {2 i (e+f x) \arctan \left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2}\right )-\frac {f \sec (c+d x)}{2 d^2}+\frac {(e+f x) \tan (c+d x) \sec (c+d x)}{2 d}}{a}\) |
-((((e + f*x)*Sec[c + d*x]^2)/(2*d) - (f*Tan[c + d*x])/(2*d^2))/a) + ((((- 2*I)*(e + f*x)*ArcTan[E^(I*(c + d*x))])/d + (I*f*PolyLog[2, (-I)*E^(I*(c + d*x))])/d^2 - (I*f*PolyLog[2, I*E^(I*(c + d*x))])/d^2)/2 - (f*Sec[c + d*x ])/(2*d^2) + ((e + f*x)*Sec[c + d*x]*Tan[c + d*x])/(2*d))/a
3.3.71.3.1 Defintions of rubi rules used
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol ] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^(I*k*Pi)*E^(I*(e + f*x))]/f), x] + (-Si mp[d*(m/f) Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))], x], x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x ))], x], x]) /; FreeQ[{c, d, e, f}, x] && IntegerQ[2*k] && IGtQ[m, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (-Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x] + S imp[b^2*((n - 2)/(n - 1)) Int[(c + d*x)*(b*Csc[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2]
Int[((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]^(n_.)*Tan[(a_.) + (b _.)*(x_)]^(p_.), x_Symbol] :> Simp[(c + d*x)^m*(Sec[a + b*x]^n/(b*n)), x] - Simp[d*(m/(b*n)) Int[(c + d*x)^(m - 1)*Sec[a + b*x]^n, x], x] /; FreeQ[{ a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]
Int[(((e_.) + (f_.)*(x_))^(m_.)*Sec[(c_.) + (d_.)*(x_)]^(n_.))/((a_) + (b_. )*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a Int[(e + f*x)^m*Sec[c + d*x]^(n + 2), x], x] - Simp[1/b Int[(e + f*x)^m*Sec[c + d*x]^(n + 1)*Tan [c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && EqQ[a ^2 - b^2, 0]
Time = 0.60 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.48
method | result | size |
risch | \(-\frac {i \left ({\mathrm e}^{i \left (d x +c \right )} d f x +{\mathrm e}^{i \left (d x +c \right )} d e +f -i f \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{2} a}-\frac {i e \arctan \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d a}+\frac {f \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{2 d a}+\frac {f \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{2 d^{2} a}-\frac {i f \,\operatorname {Li}_{2}\left (i {\mathrm e}^{i \left (d x +c \right )}\right )}{2 a \,d^{2}}-\frac {f \ln \left (1+i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{2 d a}-\frac {f \ln \left (1+i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{2 d^{2} a}+\frac {i f \,\operatorname {Li}_{2}\left (-i {\mathrm e}^{i \left (d x +c \right )}\right )}{2 a \,d^{2}}+\frac {i f c \arctan \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}\) | \(254\) |
-I*(exp(I*(d*x+c))*d*f*x+exp(I*(d*x+c))*d*e+f-I*f*exp(I*(d*x+c)))/d^2/(exp (I*(d*x+c))+I)^2/a-I/d/a*e*arctan(exp(I*(d*x+c)))+1/2/d/a*f*ln(1-I*exp(I*( d*x+c)))*x+1/2/d^2/a*f*ln(1-I*exp(I*(d*x+c)))*c-1/2*I*f*polylog(2,I*exp(I* (d*x+c)))/a/d^2-1/2/d/a*f*ln(1+I*exp(I*(d*x+c)))*x-1/2/d^2/a*f*ln(1+I*exp( I*(d*x+c)))*c+1/2*I*f*polylog(2,-I*exp(I*(d*x+c)))/a/d^2+I/d^2/a*f*c*arcta n(exp(I*(d*x+c)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 508 vs. \(2 (144) = 288\).
Time = 0.33 (sec) , antiderivative size = 508, normalized size of antiderivative = 2.95 \[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {2 \, d f x + 2 \, d e + 2 \, f \cos \left (d x + c\right ) - {\left (-i \, f \sin \left (d x + c\right ) - i \, f\right )} {\rm Li}_2\left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right )\right ) - {\left (-i \, f \sin \left (d x + c\right ) - i \, f\right )} {\rm Li}_2\left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) - {\left (i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right )\right ) - {\left (i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) - {\left (d e - c f + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) + {\left (d e - c f + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + i\right ) - {\left (d f x + c f + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + {\left (d f x + c f + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right ) + 1\right ) - {\left (d f x + c f + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + {\left (d f x + c f + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right ) + 1\right ) - {\left (d e - c f + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) + {\left (d e - c f + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + i\right )}{4 \, {\left (a d^{2} \sin \left (d x + c\right ) + a d^{2}\right )}} \]
-1/4*(2*d*f*x + 2*d*e + 2*f*cos(d*x + c) - (-I*f*sin(d*x + c) - I*f)*dilog (I*cos(d*x + c) + sin(d*x + c)) - (-I*f*sin(d*x + c) - I*f)*dilog(I*cos(d* x + c) - sin(d*x + c)) - (I*f*sin(d*x + c) + I*f)*dilog(-I*cos(d*x + c) + sin(d*x + c)) - (I*f*sin(d*x + c) + I*f)*dilog(-I*cos(d*x + c) - sin(d*x + c)) - (d*e - c*f + (d*e - c*f)*sin(d*x + c))*log(cos(d*x + c) + I*sin(d*x + c) + I) + (d*e - c*f + (d*e - c*f)*sin(d*x + c))*log(cos(d*x + c) - I*s in(d*x + c) + I) - (d*f*x + c*f + (d*f*x + c*f)*sin(d*x + c))*log(I*cos(d* x + c) + sin(d*x + c) + 1) + (d*f*x + c*f + (d*f*x + c*f)*sin(d*x + c))*lo g(I*cos(d*x + c) - sin(d*x + c) + 1) - (d*f*x + c*f + (d*f*x + c*f)*sin(d* x + c))*log(-I*cos(d*x + c) + sin(d*x + c) + 1) + (d*f*x + c*f + (d*f*x + c*f)*sin(d*x + c))*log(-I*cos(d*x + c) - sin(d*x + c) + 1) - (d*e - c*f + (d*e - c*f)*sin(d*x + c))*log(-cos(d*x + c) + I*sin(d*x + c) + I) + (d*e - c*f + (d*e - c*f)*sin(d*x + c))*log(-cos(d*x + c) - I*sin(d*x + c) + I))/ (a*d^2*sin(d*x + c) + a*d^2)
\[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {e \sec {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f x \sec {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(e*sec(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f*x*sec(c + d*x )/(sin(c + d*x) + 1), x))/a
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 725 vs. \(2 (144) = 288\).
Time = 0.34 (sec) , antiderivative size = 725, normalized size of antiderivative = 4.22 \[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 \, {\left (d e \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, d e \cos \left (d x + c\right ) + i \, d e \sin \left (2 \, d x + 2 \, c\right ) - 2 \, d e \sin \left (d x + c\right ) - d e\right )} \arctan \left (\sin \left (d x + c\right ) + 1, \cos \left (d x + c\right )\right ) - 2 \, {\left (d e \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, d e \cos \left (d x + c\right ) + i \, d e \sin \left (2 \, d x + 2 \, c\right ) - 2 \, d e \sin \left (d x + c\right ) - d e\right )} \arctan \left (\sin \left (d x + c\right ) - 1, \cos \left (d x + c\right )\right ) - 2 \, {\left (d f x \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, d f x \cos \left (d x + c\right ) + i \, d f x \sin \left (2 \, d x + 2 \, c\right ) - 2 \, d f x \sin \left (d x + c\right ) - d f x\right )} \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (d f x \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, d f x \cos \left (d x + c\right ) + i \, d f x \sin \left (2 \, d x + 2 \, c\right ) - 2 \, d f x \sin \left (d x + c\right ) - d f x\right )} \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) - 4 \, {\left (d f x + d e - i \, f\right )} \cos \left (d x + c\right ) - 2 \, {\left (f \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, f \cos \left (d x + c\right ) + i \, f \sin \left (2 \, d x + 2 \, c\right ) - 2 \, f \sin \left (d x + c\right ) - f\right )} {\rm Li}_2\left (i \, e^{\left (i \, d x + i \, c\right )}\right ) + 2 \, {\left (f \cos \left (2 \, d x + 2 \, c\right ) + 2 i \, f \cos \left (d x + c\right ) + i \, f \sin \left (2 \, d x + 2 \, c\right ) - 2 \, f \sin \left (d x + c\right ) - f\right )} {\rm Li}_2\left (-i \, e^{\left (i \, d x + i \, c\right )}\right ) + {\left (i \, d f x + i \, d e + {\left (-i \, d f x - i \, d e\right )} \cos \left (2 \, d x + 2 \, c\right ) + 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) + {\left (d f x + d e\right )} \sin \left (2 \, d x + 2 \, c\right ) - 2 \, {\left (-i \, d f x - i \, d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) + {\left (-i \, d f x - i \, d e + {\left (i \, d f x + i \, d e\right )} \cos \left (2 \, d x + 2 \, c\right ) - 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) - {\left (d f x + d e\right )} \sin \left (2 \, d x + 2 \, c\right ) - 2 \, {\left (i \, d f x + i \, d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) - 4 \, {\left (i \, d f x + i \, d e + f\right )} \sin \left (d x + c\right ) - 4 \, f}{-4 i \, a d^{2} \cos \left (2 \, d x + 2 \, c\right ) + 8 \, a d^{2} \cos \left (d x + c\right ) + 4 \, a d^{2} \sin \left (2 \, d x + 2 \, c\right ) + 8 i \, a d^{2} \sin \left (d x + c\right ) + 4 i \, a d^{2}} \]
(2*(d*e*cos(2*d*x + 2*c) + 2*I*d*e*cos(d*x + c) + I*d*e*sin(2*d*x + 2*c) - 2*d*e*sin(d*x + c) - d*e)*arctan2(sin(d*x + c) + 1, cos(d*x + c)) - 2*(d* e*cos(2*d*x + 2*c) + 2*I*d*e*cos(d*x + c) + I*d*e*sin(2*d*x + 2*c) - 2*d*e *sin(d*x + c) - d*e)*arctan2(sin(d*x + c) - 1, cos(d*x + c)) - 2*(d*f*x*co s(2*d*x + 2*c) + 2*I*d*f*x*cos(d*x + c) + I*d*f*x*sin(2*d*x + 2*c) - 2*d*f *x*sin(d*x + c) - d*f*x)*arctan2(cos(d*x + c), sin(d*x + c) + 1) - 2*(d*f* x*cos(2*d*x + 2*c) + 2*I*d*f*x*cos(d*x + c) + I*d*f*x*sin(2*d*x + 2*c) - 2 *d*f*x*sin(d*x + c) - d*f*x)*arctan2(cos(d*x + c), -sin(d*x + c) + 1) - 4* (d*f*x + d*e - I*f)*cos(d*x + c) - 2*(f*cos(2*d*x + 2*c) + 2*I*f*cos(d*x + c) + I*f*sin(2*d*x + 2*c) - 2*f*sin(d*x + c) - f)*dilog(I*e^(I*d*x + I*c) ) + 2*(f*cos(2*d*x + 2*c) + 2*I*f*cos(d*x + c) + I*f*sin(2*d*x + 2*c) - 2* f*sin(d*x + c) - f)*dilog(-I*e^(I*d*x + I*c)) + (I*d*f*x + I*d*e + (-I*d*f *x - I*d*e)*cos(2*d*x + 2*c) + 2*(d*f*x + d*e)*cos(d*x + c) + (d*f*x + d*e )*sin(2*d*x + 2*c) - 2*(-I*d*f*x - I*d*e)*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) + (-I*d*f*x - I*d*e + (I*d*f*x + I *d*e)*cos(2*d*x + 2*c) - 2*(d*f*x + d*e)*cos(d*x + c) - (d*f*x + d*e)*sin( 2*d*x + 2*c) - 2*(I*d*f*x + I*d*e)*sin(d*x + c))*log(cos(d*x + c)^2 + sin( d*x + c)^2 - 2*sin(d*x + c) + 1) - 4*(I*d*f*x + I*d*e + f)*sin(d*x + c) - 4*f)/(-4*I*a*d^2*cos(2*d*x + 2*c) + 8*a*d^2*cos(d*x + c) + 4*a*d^2*sin(2*d *x + 2*c) + 8*I*a*d^2*sin(d*x + c) + 4*I*a*d^2)
\[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )} \sec \left (d x + c\right )}{a \sin \left (d x + c\right ) + a} \,d x } \]
Timed out. \[ \int \frac {(e+f x) \sec (c+d x)}{a+a \sin (c+d x)} \, dx=\text {Hanged} \]